package quq.missq.activity;

import android.os.Bundle;
import android.view.View;
import android.webkit.WebChromeClient;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.widget.ImageView;
import android.widget.TextView;

import quq.missq.BaseActivity;
import quq.missq.Constants;
import quq.missq.R;
import quq.missq.huanxin.Constant;

/**
 * Created by River on 9/21/15.
 */
public class NvShenActivity extends BaseActivity implements View.OnClickListener{

    private WebView mWebView;
    private ImageView mBack;
    private TextView mHeadTitle;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.nvshen_activity);
        initView();
        initListener();
        initData();
    }

    private void initView(){
        mWebView = (WebView)findViewById(R.id.webView);
        mHeadTitle = (TextView)findViewById(R.id.head_title);
        mBack = (ImageView)findViewById(R.id.back);
    }

    private void initListener(){
        mBack.setOnClickListener(this);
    }

    private void initData(){
        mHeadTitle.setText("我要当女神");
        mWebView.setWebChromeClient(new WebChromeClient());
        mWebView.getSettings().setJavaScriptEnabled(true);
        mWebView.getSettings().setJavaScriptCanOpenWindowsAutomatically(true);
        mWebView.getSettings().setAllowFileAccess(true);
        mWebView.getSettings().setDefaultTextEncodingName("UTF-8");
        mWebView.getSettings().setLoadWithOverviewMode(true);
        mWebView.getSettings().setUseWideViewPort(true);
        //mWebView.setVisibility(View.VISIBLE);
        mWebView.loadUrl(Constants.BE_NVSHEN_URL);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()){
            case R.id.back:
                finish();
                break;
        }
    }


}
